'use strict';
/**
 * middleware
 */
export default class extends think.middleware.base {
    /**
     * run
     * @return {} []
     */
    run() {
        let lang = this.http.get('lang');
        if (!lang) {
            lang = 'zh';
        }
        let langs = think.config("lang");
        if (lang && langs.indexOf(lang) >= 0) {
            this.http.lang(lang); //设置语言
            return;
        }
        this.http.error = new Error('lang is not supported!');
        return think.statusAction(403, this.http);
    }
}